﻿using System;
using System.Collections.Generic;
using Microsoft.Practices.Prism.Modularity;

namespace MyFramework.Common.Interfaces
{
    /// <summary>
    /// Interface controller factory
    /// </summary>
    public interface IControllerFactory : IModule
    {
        /// <summary>
        /// Creates the controller.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="initParameters">The initialize parameters.</param>
        /// <param name="onCreatedAction">The on created action.</param>
        /// <param name="onInitializedAction">The on initialized action.</param>
        /// <param name="onException">The on exception.</param>
        void CreateController(Type type, IDictionary<string, object> initParameters, Action<IController> onCreatedAction, Action<IController> onInitializedAction, Action<Exception> onException);

        /// <summary>
        /// Creates the controller synchronize.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="initParameters">The initialize parameters.</param>
        /// <param name="onCreatedAction">The on created action.</param>
        /// <param name="onInitializedAction">The on initialized action.</param>
        /// <param name="onException">The on exception.</param>
        void CreateControllerSync(Type type, IDictionary<string, object> initParameters, Action<IController> onCreatedAction, Action<IController> onInitializedAction, Action<Exception> onException);
    }
}
